import request from '@/router/axios';

export const getList = (page, size, params) => {
  return request({
    url: '/cms/cmsComment/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}

export const getDetail = (id) => {
    return request({
        url: '/cms/cmsComment/list',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id,
        }
    })
}

export const remove = (id) => {
  return request({
    url: '/cms/cmsComment/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      id,
    }
  })
}

export const removeAll = (ids) => {
    return request({
        url: '/cms/cmsComment/removeAll',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            ids,
        }
    })
}

export const add = (row) => {
  return request({
    url: '/cms/cmsComment/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const replyComment = (commentType,commentId,content,anonymous,score) => {
    return request({
        url: '/cms/cmsComment/replyComment',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            commentType,
            commentId,
            content,
            anonymous,
            score
        }
    })
}


export const update = (id,status) => {
  return request({
    url: '/cms/cmsComment/editItem',
    method: 'post',
      meta: {
          isSerialize: true,
      },
      data: {
          id,
          status
      }
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/cms/cmsComment/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}